<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <style>
        body{
            padding: 200px;
        }
        #father{
            width: 100px;
            height: 100px;
            border: 1px solid red;
            position: relative; //父级元素相对定位
        }
        #first{
          background: green;
            border: 1px solid red;
        }
        #second{
            background: red;
            border: 1px solid red;
            position: absolute; //相对于父级元素进行绝对定位
        }
    </style>
</head>
<body>
  <div id="father">
      <div id="first">第一个盒子</div>
      <div id="second">第二个盒子</div>
  </div>

</body>
</html>